package com.zsrt.java.day20161223.lh.day1222;

import static org.junit.Assert.*;

import org.junit.Test;
/**
 * = 赋值
 * ==等于
 */

public class Testmath {
	@Test
	public void testName() throws Exception {
		//变量在一定的区域内不能重复定义 在中国一夫一妻制
		int money=5000;
		//int money=444;
		System.out.println(money);
		
	}
	@Test
	public void testName1() throws Exception {
		int money=5000;
		money=money+1000;
		System.out.println(money);
		
	}
	@Test
	public void equal() throws Exception {
		int a=11;
		int b=11;
		System.out.println(a==b);
		
	}
	@Test
	public void addqu() throws Exception {
		int a=11;
		int b=a%=4;
		System.out.println(b);
		
	}
	
	@Test
	public void mod() throws Exception {
		/**
		 *     /代表是除法 结果整个结果的整数部分 a=9
		 *     
		 */
		int a =49/5;
		System.out.println(a);
		/**
		 *   %代表是求模 结果取整个结果的余数部分 4
		 */
		int b=49%5;
		System.out.println(b);
	}
	@Test
	public void addsub() throws Exception {
		int a=10;
		int b=10;
		int c=++a;
		int d=b--;
		int e=c++;
		int f=++d;
		System.out.println("a="+a+"b="+b+"c="+c+"d="+d+"e="+e+"f="+f);
	}
	@Test
	public void subsub01() throws Exception {
		int a=10;
		int b=--a;
		System.out.println("b="+b);
		System.out.println("a="+a);
		
	}
	@Test
	public void addadd03() throws Exception {
		int a=10;
		int b=++a;
		/*int b=a+1;
		a=a+1;*/
		System.out.println("a="+a);
		System.out.println("b+"+b);
		
		
	}
	@Test
	public void addadd02() throws Exception {
		int a=10;
		//共同点 a=11;
		//区别：不等于多少看等于后面接的第1个符号
		//如果=后面接的是a 先取后加 b=10
		//如果=后面接的是+ 先加后去 b=10
		int b=a++;
		/*int b=a;
		a=a+1;*/
		System.out.println("a="+a);
		System.out.println("b="+b);
		
	}

	@Test
	public void addadd01(){
		
		int a =10;
		a++;
		System.out.println(a);
		
	}
	
	@Test
	public void sum02(){
		
		int a =10;
		int b =20;
		int sum= a+b;
		
		sum = sum++;
		System.out.println(sum);
		
	}
	@Test
	public void sum01(){
		
		int a =10;
		int b =20;
		int sum= a+b;
		sum=sum+1;
		System.out.println(sum);
		
	}
}
